package com.lmy.springbootMyBatisPlus.controller;

import com.lmy.springbootMyBatisPlus.bean.Monster;
import com.lmy.springbootMyBatisPlus.service.MonsterService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class MonsterController {

    @Resource
    private MonsterService monsterService;

    @ResponseBody
    @RequestMapping(value = "/getById/{id}")
    public Monster getMonster(@PathVariable(value = "id") Integer id) {
        Monster monster = monsterService.getById(id);
        return monster;
    }
}
